package com.core.cloudbusiness;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.core.cloudcommon.CommonGlobalExceptionHandler;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableAsync;

/**
 * @Author: lqj
 * @Date: 2024/11/12/ 19:48
 * @Description: 业务模块
 */
@SpringBootApplication
//*星号是通配符，有多少层级就加多少
@MapperScan(basePackages = {"com.core.cloudbusiness.*.*.mapper"})
// 导入全局异常处理
@Import({CommonGlobalExceptionHandler.class})
@ComponentScan({"com.core.cloudbusiness","com.core.cloudcommon.redis.service","com.core.cloudcommon.security","com.core.cloudcommon.utils","com.core.cloudcommon.config","com.core.cloudcommon.trace"})
@EnableAsync
public class CloudBusinessApplication {

    public static void main(String[] args) {
        SpringApplication.run(CloudBusinessApplication.class, args);
    }

    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }

}
